package com.karst87.sqlite.study
{
	import flash.events.SQLEvent;
	
	import org.aswing.JPanel;

	public class SQLiteStudyPanel extends JPanel
	{
		public function SQLiteStudyPanel()
		{
			createDB() ;
		}

		private var dbDealer : DataBaseDealer = null ;
		private function createDB() : void
		{
			if( dbDealer == null )
				dbDealer = new DataBaseDealer() ;
			dbDealer.addEventListener( SQLEvent.OPEN, dbOpenHandler ) ;
			dbDealer.createSqlConn() ;
		}
		
		private var tableDealer : TableDealer = null ;
		private function dbOpenHandler( $event : SQLEvent ) : void
		{
			if( tableDealer == null )
				tableDealer = new TableDealer( dbDealer.getSqlConn() ) ;
//			tableDealer.createTabel() ;
//			tableDealer.insertData( "karst87", "KK", 100000 ) ;
			tableDealer.searchData( "FIRSTNAME", "" ) ;
		}
	}
}